package com.thinkgem.jeesite.modules.task.uk.taskjob;

import java.util.Date;

import com.thinkgem.jeesite.common.utils.Constons;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.thinkgem.jeesite.common.utils.CalendarUtils;
import com.thinkgem.jeesite.modules.paypaymentdetails.service.PaydayPaymentDetailsService;

/**
 * Created by xiaole.zheng on 2017/8/9.
 */
@Component("paydayPaymentDetailTask")
public class PaydayPaymentDetailTask {
    @Autowired
    private PaydayPaymentDetailsService paydayPaymentDetailsService;

   public void doSomeThing(){
       Date endDay = new Date();
       int dayOfMouth =  CalendarUtils.getDay(endDay);
       if(dayOfMouth==1){//每月一号统计
           Date startDay = CalendarUtils.diffMouth(endDay,1);
           endDay = CalendarUtils.diffDate(endDay,1);
        paydayPaymentDetailsService.genToPaydayPaymentDetailsService(Constons.WarehouseType.UKLE, startDay,endDay);
       }
   }
}
